// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov  Date: 2007-9-15 18:53:50

// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   hn.java

package com.zelix;

import java.util.*;

// Referenced classes of package com.zelix:
//            kn, mn, rn, un, 
//            yn, px, sx, ux, 
//            wn, du

public class hn
        implements kn {

    private int a;
    private HashSet b[];
    private ArrayList c;

    public hn(int l) {
        a = l;
        b = new HashSet[l];
        c = new ArrayList();
    }

    public hn(int l, ArrayList arraylist) {
        a = l;
        b = new HashSet[l];
        c = arraylist;
    }

    void a(int l, kn kn1) {
        HashSet hashset = new HashSet(3);
        hashset.add(kn1);
        b[l] = hashset;
        if (kn1 instanceof yn)
            c.add(((yn) kn1).g());
    }

    void a(int l, HashSet hashset) {
        b[l] = hashset;
    }

    public boolean equals(Object obj) {
        if (obj instanceof hn) {
            hn hn1 = (hn) obj;
            return b.equals(hn1.b) && c.equals(hn1.c);
        } else {
            return false;
        }
    }

    public String a() {
        StringBuffer stringbuffer;
        int l;
        stringbuffer = new StringBuffer();
        for (l = 0; l < b.length; l++) {
            Iterator iterator;
            HashSet hashset = b[l];
            stringbuffer.append("[");
            iterator = hashset.iterator();
            while (iterator.hasNext()) {
                kn kn1 = (kn) iterator.next();
                stringbuffer.append(kn1.a());
                if (iterator.hasNext())
                    stringbuffer.append(",");
            }
            stringbuffer.append("]");
        }
        return stringbuffer.toString();
    }

    public ArrayList g() {
        ArrayList arraylist;
        int l;
        arraylist = new ArrayList();
        for (l = 0; l < b.length; l++) {
            kn kn1 = null;
            Iterator iterator = b[l].iterator();
            if (iterator.hasNext())
                kn1 = (kn) iterator.next();
            arraylist.add(kn1);
        }
        return arraylist;
    }

    public String b() {
        throw new RuntimeException();
    }

    public int c() {
        return -1;
    }

    public ArrayList h() {
        ArrayList arraylist;
        int l;
        boolean flag;
        flag = wn.C;
        arraylist = new ArrayList();
        for (l = 0; l < b.length; l++) {
            Iterator iterator = b[l].iterator();
            while (iterator.hasNext()) {
                kn kn1 = (kn) iterator.next();
                if (kn1.f() && (kn1 instanceof un))
                    arraylist.add(kn1);
            }
        }
        return arraylist;
    }

    public int i() {
        return b.length;
    }

    public String d() {
        return b();
    }

    public String[][] j() {
        int l;
        HashSet ahashset[];
        int i1;
        boolean flag;
        flag = wn.C;
        if (b.length == 0)
            return new String[0][0];
        l = 1;
        ahashset = new HashSet[b.length];
        for (i1 = 0; i1 < b.length; i1++) {
            HashSet hashset1;
            Iterator iterator;
            HashSet hashset = b[i1];
            int j1 = hashset.size();
            if (j1 == 0)
                return null;
            hashset1 = new HashSet(px.a(hashset.size()));
            iterator = hashset.iterator();
            while (iterator.hasNext()) {
                kn kn1 = (kn) iterator.next();
                hashset1.add(kn1.d());
            }
            l *= hashset1.size();
            ahashset[i1] = hashset1;
        }
        String as[][] = new String[l][ahashset.length];
        sx sx1 = new sx(0);
        a(as, ahashset, sx1, 0, new String[ahashset.length]);
        return as;
    }

    private void a(String as[][], HashSet ahashset[], sx sx1, int l, String as1[]) {
        Iterator iterator;
        boolean flag;
        flag = wn.C;
        iterator = ahashset[l].iterator();
        while (iterator.hasNext()) {
            String as2[] = new String[as1.length];
            System.arraycopy(as1, 0, as2, 0, l);
            as2[l] = (String) iterator.next();
            if (l + 1 < as1.length) {
                a(as, ahashset, sx1, l + 1, as2);
            } else {
                as[sx1.b()] = as2;
                sx1.c();
            }
        }
    }

    public boolean k() {
        int l;
        boolean flag;
        flag = wn.C;
        for (l = 0; l < b.length; l++) {
            HashSet hashset = b[l];
            int i1 = hashset.size();
            if (i1 == 0)
                return false;
            if (i1 > 1) {
                String s = null;
                Iterator iterator = hashset.iterator();
                while (iterator.hasNext()) {
                    kn kn1 = (kn) iterator.next();
                    if (kn1.f()) {
                        String s1 = kn1.b();
                        if (s == null) {
                            s = s1;
                        } else if (!s.equals(s1))
                            return false;
                    } else {
                        return false;
                    }
                }
            }
        }
        return true;
    }

    public int hashCode() {
        return b.hashCode() ^ c.hashCode();
    }

    public boolean e() {
        int l;
        boolean flag;
        flag = wn.C;
        for (l = 0; l < b.length; l++) {
            Iterator iterator;
            HashSet hashset = b[l];
            iterator = hashset.iterator();
            while (iterator.hasNext()) {
                kn kn1 = (kn) iterator.next();
                if (kn1.e())
                    return true;
            }
        }
        return false;
    }

    public boolean f() {
        int l;
        if (c.size() > 0)
            return false;
        for (l = 0; l < b.length; l++) {
            Iterator iterator;
            HashSet hashset = b[l];
            iterator = hashset.iterator();
            while (iterator.hasNext()) {
                kn kn1 = (kn) iterator.next();
                if (!kn1.f())
                    return false;
            }
        }
        return true;
    }

    void a(HashMap hashmap, ux ux1, du du) {
        int l;
        for (l = 0; l < b.length; l++) {
            HashSet hashset;
            Iterator iterator;
            hashset = b[l];
            HashSet hashset1 = (HashSet) hashset.clone();
            iterator = hashset1.iterator();
            while (iterator.hasNext()) {
                kn kn1 = (kn) iterator.next();
                if (kn1.e() && (kn1 instanceof mn)) {
                    mn mn1 = (mn) kn1;
                    if (mn1.g() == du) {
                        rn rn1 = (rn) hashmap.get(ux1.a(kn1.c()));
                        if (rn1 != null) {
                            HashSet hashset2 = rn1.b(0);
                            hashset.remove(kn1);
                            hashset.addAll(hashset2);
                        }
                    }
                }
            }
        }
    }
}